Builder

constructor(@NonNull context: Context, @NonNull notification: Notification)(source)

Creates a NotificationCompat.Builder which can be used to build a notification that is equivalent to the given one, such that updates can be made to an existing notification with the NotificationCompat.Builder API.


constructor(@NonNull context: Context, @NonNull channelId: String)(source)

Constructor. Automatically sets the when field to System.currentTimeMillis() and the audio stream to the STREAM_DEFAULT.

Parameters

context

A Context that will be used to construct the RemoteViews. The Context will not be held past the lifetime of this Builder object.

channelId

The constructed Notification will be posted on this NotificationChannel.


constructor(@NonNull context: Context)(source)

Deprecated

use Builder(Context, String) instead. All posted notifications must specify a NotificationChannel ID.